var  BASE = BASE||{}; //全局公用方

BASE.PROJECTCOMMON = (function () {
    function uploadProjectfile(obj) {
        BASE.UPLOADANSWER.uploadFile(obj,function (url) {
            var name = obj.files[0].name || '项目需求表';
            BASE.clearpop('上传成功');
            $('body').data('file-url',url);
            $('#fileUrlLink').fadeIn().find('span').text(name);
        })
    }
    /*删除需求文件*/
    function removeFile() {
        $('body').data('file-url','');
        $('#fileUrlLink').fadeOut();
    }
    /*获取qq*/
    function getQQList() {
        var qqlist =  BASE.getStore('qqlist');
        if(qqlist){
            var data = JSON.parse(qqlist)[0];
            $('#projectlinkQQ').html(template('projectlinkQQ_tpl',{data:data}));
            return;
        }
        BASE.apiGet('/device/member/kefuList',function (res) {
            BASE.setStore('qqlist',res);
            $('#projectlinkQQ').html(template('projectlinkQQ_tpl',{data:res[0]}));
        })
    }
    return{
        removeFile:removeFile,
        uploadProjectfile:uploadProjectfile,
        getQQList:getQQList,
    }
})();

